package com.util;

import java.sql.Connection;

import net.snapbug.util.dbtool.ConnectionManager;
import net.snapbug.util.dbtool.ConnectionPool;

/** 
 * @author 作者：zhaosj 
 * @version 创建时间：Dec 16, 2009 3:30:02 PM 
 * 类说明 
 */
public class ConnUtil {
	static {
		try {
			ConnectionManager.init("conf/DatabasePool.properties");
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}
	
	public static Connection getConnection(String poolName) {
		Connection conn = null;
		try {
			ConnectionPool pool = ConnectionManager.getConnectionPool(poolName);
			conn = pool.createStatement().getConnection();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return conn;
	}

}

